﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WFASmartketing.REPORTES
{
    public partial class ReporteGastos : Form
    {
        public ReporteGastos()
        {
            InitializeComponent();
        }

        private void ReporteGastos_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'tipodeGastoDS.tipogasto' table. You can move, or remove it, as needed.
            this.tipogastoTableAdapter.Fill(this.tipodeGastoDS.tipogasto);
            // TODO: This line of code loads data into the 'tipodeGastoDS.tipogasto' table. You can move, or remove it, as needed.
            // TODO: This line of code loads data into the 'bD_SMARTKETINGDataSet.tipogasto' table. You can move, or remove it, as needed.
             // TODO: This line of code loads data into the 'ReporteGastosDS.gastos_ReporteGastos' table. You can move, or remove it, as needed.

            //this.gastos_ReporteGastosTableAdapter.Fill(this.ReporteGastosDS.gastos_ReporteGastos);
            DateTime dINI=DTCINI.Value;
            DateTime dFin = DTCFIN.Value;
            string tipoGasto=CBXTIPOGASTO.SelectedValue.ToString();
            this.gastos_ReporteGastosTableAdapter.Fill(this.ReporteGastosDS.gastos_ReporteGastos,tipoGasto,dINI,dFin);
            this.reportViewer1.RefreshReport();
        }

        private void CBXTIPOGASTO_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void reportViewer1_Load(object sender, EventArgs e)
        {
        }

        private void reportViewer1_ReportRefresh(object sender, CancelEventArgs e)
        {
            DateTime dINI = DTCINI.Value;
            DateTime dFin = DTCFIN.Value;
            string tipoGasto = CBXTIPOGASTO.SelectedValue.ToString();
            this.gastos_ReporteGastosTableAdapter.Fill(this.ReporteGastosDS.gastos_ReporteGastos, tipoGasto, dINI, dFin);
            this.reportViewer1.RefreshReport();
        }

        private void button2_Click(object sender, EventArgs e)
        {

            DateTime dINI = DTCINI.Value;
            DateTime dFin = DTCFIN.Value;
            string tipoGasto = CBXTIPOGASTO.SelectedValue.ToString();
            this.gastos_ReporteGastosTableAdapter.Fill(this.ReporteGastosDS.gastos_ReporteGastos, tipoGasto, dINI, dFin);
            this.reportViewer1.RefreshReport();
        }
    }
}
